Skip to content

fix(aggregator): /api/actions.json?state=all returns history (#4620) - #7669

Merged
dezren39 merged 1 commit into
mainfrom
queue/13245-4620-actions-state-all
Nov 8, 2026
Merged

dezren39 merged 1 commit into
mainfrom
queue/13245-4620-actions-state-all

Conversation

@developing-today

@developing-today developing-today Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

Closes #4620.

Problem

GET /api/actions.json?state=all returned {"actions": []} while the actions store held applied history: the handler passed the state query value straight into a literal a.state === state filter, and no action ever has state "all". Audit/retrospective consumers (the weekly triage retrospective) read a false zero.

Fix

  • state=all is now the explicit all-history read (no state filter applied).
  • Any other state value that is not a real action state (new, applied, rejected, superseded) returns 400 instead of a silent empty list, so a mistyped filter cannot masquerade as "no history".
  • ACTION_STATES is exported from src/actions.ts and reused by the handler.
  • ?state=new behaviour is unchanged.

Tests

New regression test in test/actions.test.ts: posts an action, applies it, then pins that ?state=all and ?state=applied return it, ?state=new does not, and ?state=bogus is a 400.

Local (laptop): bun test test/actions.test.ts — 26 pass, 0 fail (run with PM_AGG_FRESHNESS_PORT=4899 because the live aggregator holds the default IPC port 4871 on that host).

Queue task 13245, lane code-c.


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

@developing-today
developing-today Bot requested review from a team and dezren39 as code owners November 8, 2026 11:55
@coderabbitai

coderabbitai Bot commented Nov 8, 2026

Copy link
Copy Markdown

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: a9abe4d5-ee30-4418-8e08-fc20e6f36182

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

aggregator: /api/actions.json?state=all returns empty while the actions store holds history — audit/retrospective reads get a false zero

1 participant